package com.ruffian.widget;


import com.ruffian.library.RTextView;
import junit.framework.TestCase;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.app.Context;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;

public class RTextViewTestCase extends TestCase {
    private Context context;
    private RTextView rTextView;
    @Before
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        context = AbilityDelegatorRegistry.getAbilityDelegator().getAppContext();
        rTextView = new RTextView(context);
    }
    @Test
    public void testSetAndGetBackgroundColorNormal(){
        int color = 0xFFFFFFFF;
        rTextView.setBackgroundColorNormal(color);
        int bgColor =rTextView.getBackgroundColorNormal();
        Assert.assertEquals(color,bgColor);
    }
    @Test
    public void testSetAndGetBackgroundColorPressed(){
        int color = 0xFFFFFFFF;
        rTextView.setBackgroundColorPressed(color);
        int bgColor =rTextView.getBackgroundColorPressed();
        Assert.assertEquals(color,bgColor);
    }
    @Test
    public void testSetAndGetBackgroundUnable(){
        int color = 0xFFFFFFFF;
        rTextView.setBackgroundColorUnable(color);
        int bgColor =rTextView.getBackgroundColorUnable();
        Assert.assertEquals(color,bgColor);
    }

}
